package com.xdf.docmanagementsystem.service.impl;

import com.xdf.docmanagementsystem.common.util.Example;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.xdf.docmanagementsystem.entity.EmergencyContactPerson;

import java.util.List;

import com.xdf.docmanagementsystem.dao.EmergencyContactPersonMapper;
import com.xdf.docmanagementsystem.service.EmergencyContactPersonService;

/**
 * @Description : com.xdf.docmanagementsystem.service.impl(业务层实现类,该类为生成器自动生成).
 * @Author : ZK
 * @Date : 2020-06-27 16:53:02
 */
@Service
public class EmergencyContactPersonServiceImpl implements EmergencyContactPersonService {
    @Autowired
    private EmergencyContactPersonMapper dao;

    /**
     * @Describe 新增方法
     * @author ZK
     * @Date 2020-06-27 16:53:02
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insert(EmergencyContactPerson record) throws Exception {
        return dao.insert(record);
    }

    /**
     * @Describe 选择新增
     * @author ZK
     * @Date 2020-06-27 16:53:02
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertSelective(EmergencyContactPerson record) throws Exception {
        return dao.insertSelective(record);
    }

    /**
     * @Describe 批量新增
     * @author ZK
     * @Date 2020-06-27 16:53:02
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int multiInsert(List<EmergencyContactPerson> list) throws Exception {
        return dao.multiInsert(list);
    }

    /**
     * @Describe 修改
     * @author ZK
     * @Date 2020-06-27 16:53:02
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateByPrimaryKey(EmergencyContactPerson record) throws Exception {
        return dao.updateByPrimaryKey(record);
    }

    /**
     * @Describe 选择修改
     * @author ZK
     * @Date 2020-06-27 16:53:02
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateByPrimaryKeySelective(EmergencyContactPerson record) throws Exception {
        return dao.updateByPrimaryKeySelective(record);
    }

    /**
     * @Describe 修改
     * @author ZK
     * @Date 2020-06-27 16:53:02
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int update(EmergencyContactPerson record) throws Exception {
        return dao.updateByPrimaryKey(record);
    }

    /**
     * @Describe 批量修改
     * @author ZK
     * @Date 2020-06-27 16:53:02
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int multiUpdate(List<EmergencyContactPerson> list) throws Exception {
        return dao.multiUpdate(list);
    }

    /**
     * @Describe 根据主键查询
     * @author ZK
     * @Date 2020-06-27 16:53:02
     */
    @Override
    public EmergencyContactPerson selectByPrimaryKey(Integer id) throws Exception {
        return dao.selectByPrimaryKey(id);
    }

    /**
     * @Describe 根据主键删除
     * @author ZK
     * @Date 2020-06-27 16:53:02
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteByPrimaryKey(Integer id) throws Exception {
        return dao.deleteByPrimaryKey(id);
    }

    /**
     * @Describe 根据Entity查询
     * @author ZK
     * @Date 2020-06-27 16:53:02
     */
    @Override
    public List<EmergencyContactPerson> listQuery(EmergencyContactPerson record) throws Exception {
        return dao.selectByParam(record);
    }

    /**
     * 查询
     *
     * @param example
     * @return
     * @throws Exception
     */
    @Override
    public List<EmergencyContactPerson> selectByExample(Example example) throws Exception {
        return dao.selectByExample(example);
    }

    /**
     * @param emergencyContactPerson
     * @param example
     * @return
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    @Override
    public int updateByExampleSelective(EmergencyContactPerson emergencyContactPerson, Example example) throws Exception {
        return dao.updateByExampleSelective(emergencyContactPerson, example);
    }

}